package com.zhb.cms.oauth;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@EnableAuthorizationServer
@SpringBootApplication
@EnableDiscoveryClient
public class OAuthServerApplication extends WebMvcConfigurerAdapter
{

	public static void main(String[] args)
	{
		SpringApplication.run(OAuthServerApplication.class, args);
	}

	/**
	 * mvc cofig
	 */
	@Override
	public void addViewControllers(ViewControllerRegistry registry)
	{
		registry.addViewController("/login").setViewName("login");
		registry.addViewController("/oauth/confirm_access").setViewName("authorize");
	}

}
